package com.heima.apis.article.fallback;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.common.enums.AppHttpCodeEnum;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * ClassName: IArticleClientFallback
 * Description:
 * date: 2023/8/11 0011 15:30
 *
 * @author zHan
 */
@Component
@Slf4j
public class ArticleClientFallbackFactory implements FallbackFactory {

    /**
     * @param throwable
     * @return
     */
    @Override
    public Object create(Throwable throwable) {
        return ResponseResult.errorResult(AppHttpCodeEnum.SERVER_ERROR, "获取数据失败");
    }
}
